extensions: clamping to [0.0, 1.0] is not needed
authorTéo Mazars <teo.mazars@ensimag.fr>
Sun, 30 Jun 2013 13:58:43 +0000 (15:58 +0200)
committerTéo Mazars <teo.mazars@ensimag.fr>
Sun, 30 Jun 2013 14:01:26 +0000 (16:01 +0200)
As babl allows out of sRGB gamut values.

extensions/CIE.c

index b83a07e69776e90755f7323bfb97c257e234cdf6..5f340513ad14344219fc07869746df9406cf5866 100644 (file)
@@ -933,11 +933,6 @@ static const double LRAMP = 7.99959199;
 static double xnn, znn;
 
 
-#ifndef CLAMP
-#define CLAMP(x, l, u)    ((x) < (l) ? (l) : ((x) > (u) ? (u) : (x)))
-#endif
-
-
 typedef double CMatrix[3][3];
 typedef double CVector[3];
 
@@ -1282,11 +1277,6 @@ cpercep_space_to_rgb (double  inr,
 
   xyz_to_rgb (&inr, &ing, &inb);
 
-  /* yes, essential.  :( */
-  inr = CLAMP (inr, 0.0, 1.0);
-  ing = CLAMP (ing, 0.0, 1.0);
-  inb = CLAMP (inb, 0.0, 1.0);
-
   *outr = inr;
   *outg = ing;
   *outb = inb;